package com.ruoyi.zyx.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.zyx.mapper.ZyxCostMapper;
import com.ruoyi.zyx.domain.ZyxCost;
import com.ruoyi.zyx.service.IZyxCostService;

/**
 * 费用明细
Service业务层处理
 *
 * @author lhs
 * @date 2021-06-18
 */
@Service
public class ZyxCostServiceImpl implements IZyxCostService
{
    @Autowired
    private ZyxCostMapper zyxCostMapper;

    /**
     * 查询费用明细
     *
     * @param id 费用明细ID
     * @return 费用明细
     */
    @Override
    public ZyxCost selectZyxCostById(Long id)
    {
        return zyxCostMapper.selectZyxCostById(id);
    }

    /**
     * 查询费用明细列表
     *
     * @param zyxCost 费用明细
     * @return 费用明细
     */
    @Override
    public List<ZyxCost> selectZyxCostList(ZyxCost zyxCost)
    {
        return zyxCostMapper.selectZyxCostList(zyxCost);
    }

    /**
     * 新增费用明细
     *
     * @param zyxCost 费用明细
     * @return 结果
     */
    @Override
    public int insertZyxCost(ZyxCost zyxCost)
    {
        zyxCost.setCreateTime(DateUtils.getNowDate());
        return zyxCostMapper.insertZyxCost(zyxCost);
    }

    /**
     * 修改费用明细
     *
     * @param zyxCost 费用明细
     * @return 结果
     */
    @Override
    public int updateZyxCost(ZyxCost zyxCost)
    {
        zyxCost.setUpdateTime(DateUtils.getNowDate());
        return zyxCostMapper.updateZyxCost(zyxCost);
    }

    /**
     * 批量删除费用明细
     *
     * @param ids 需要删除的费用明细ID
     * @return 结果
     */
    @Override
    public int deleteZyxCostByIds(Long[] ids)
    {
        return zyxCostMapper.deleteZyxCostByIds(ids);
    }

    /**
     * 删除费用明细信息
     *
     * @param id 费用明细ID
     * @return 结果
     */
    @Override
    public int deleteZyxCostById(Long id)
    {
        return zyxCostMapper.deleteZyxCostById(id);
    }
}
